import { request } from "@/utils/request";

/**
 * 获取所有文章
 * @param start
 * @param size
 * @returns
 */
export const mangetallessayapi = (
  start: number,
  size: number,
  search: string,
  starttime: string,
  endtime: string
) => {
  return request.get(
    `/essay/mangetallessay?start=${start}&size=${size}&search=${search}&starttime=${starttime}&endtime=${endtime}`
  );
};

/**
 * 删除指定文章
 * @param id
 * @returns
 */
export const deleteessaybyidapi = (id: number) => {
  return request.delete(`/essay/deleteessaybyid/${id}`);
};

/**
 * 获取所有需要审核的文章
 * @returns
 */
export const allcheckeapi = (start: number, size: number, search: string) => {
  return request.get(
    `/essay/allchecke?start=${start}&size=${size}&search=${search}`
  );
};

/**
 * //改变文章审核状态
 * @param essayid
 * @param state
 * @returns
 */
export const changestateapi = (essayid: number, state: number) => {
  return request.patch(`/essay/changestate/${essayid}?state=${state}`);
};
